window.onload=function(){
	//获取所有cookie
var pbId = sessionStorage.getItem("pbId");
var userId = sessionStorage.getItem("userId");

		 $.ajax({
		    type:"POST",
		    url:"http://www.youyiku-yishu.cn/WebApp/AppPhotoBooks/page",
		    data:{pbId:pbId,userId:userId},
		    dataType:"json",
		       beforeSend: function (XMLHttpRequest) {
		         		XMLHttpRequest.setRequestHeader("DEVICEINFO", "JxRaZezavm3HXM3d9pWnYiqqQC1SJbsU");
		       }
		 }).then(data=>{
		 	console.log(data)
		  	   var master=data.master;
		  	   var totalPic=data.totalPic;
		  	   totalPic=Number(totalPic);
		  	   $('.quantity_span').html(totalPic);
		  	   $('#quantity').val(totalPic);
		  	   //判断是否显示图片库的数量
				var quantity=$('#quantity').val();
				var quantity=Number(quantity);
				if(quantity==0){
					$('.quantity').css('display','none')
				}else{
					$('.quantity').css('display','block')
				}
		  	   var master=$('#master').val(master);		  	   
		 	   var totalPage=data.totalPage;
		 	   var totalPage=$('#all_page').val(totalPage);
		  	   var totalPage=$('#all_page').val();
		  	   $('.Span2').html(totalPage);		  	   		  			  	   			
		       var style=(data.style);
		       var realPage=Number(data.realPage);
		       if(realPage==0){
		       	$('#current_page').val(0);
		       }else{
		       	$('#current_page').val(1);
		       }
		       
		       $('#style').val(style);
		        		$("head").append("<link>");
   						 css = $("head").children(":last");
   						   css.attr({
					        rel: "stylesheet",
					        type: "text/css",
					        href:"http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photoNewBook/parentOffspring"+style+".css"
					    });
					    
					    $.getScript("../js/photoNewBook/parentOffspring"+style+".js",function(){
							});
		
		    });
	
}